package com.roadmap.ajax.handler;

import com.roadmap.ajax.proxy.BaseProxy;
import com.roadmap.common.RdcConst;
import com.roadmap.common.RdcErrorMessage;
import com.roadmap.entities.Article;

public class BlogHandler extends BaseProxy {

	public Object saveArticle(String aspirantId, Article art) {
		try {
			return art.getId() == null ? create(art) : update(art);
		}
		catch (Exception e) {
			return RdcErrorMessage.getMessageToClient(e);
		}
	}

	public Object deleteArticle(String aspirantId, String artId) {
		try {
			return delete(RdcConst.BLOG, artId);
		}
		catch (Exception e) {
			return RdcErrorMessage.getMessageToClient(e);
		}
	}
}
